package cn.jofei.common.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * RequestMethod枚举
 *
 * @author Jofei Bao
 * @version ngbao v1.0.2
 * @date 2022/7/8 15:54
 */
public enum RequestMethod {
    GET,
    HEAD,
    POST,
    PUT,
    DELETE,
    CONNECT,
    OPTIONS,
    TRACE,
    PATCH
    ;
    private static final Map<String, RequestMethod> methods = new HashMap<>();

    static {
        for (RequestMethod value : RequestMethod.values()) {
            methods.put(value.name(), value);
        }
    }

    public static RequestMethod getMethod(String method) {
        return methods.get(method);
    }
}
